/**
 * Created by whj on 17-5-9.
 */

import jsonp from 'jsonp'
export default function (url, result) {
  result.guodu = true
  result.error = ''
  result.data = null

  jsonp(url, {timeout: 5000}, function (err, data) {
    console.log('访问' + url + ':')
    if (err) {
      result.error = err.message
      console.log(err.message)
    } else {
      result.data = data
      console.log(data)
    }
    result.guodu = false
  })
}
